<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>今年是什么年</title>
    <script>
        function year() {
            let y = prompt("请输入年份");
            if (isNaN(y)){
                alert("请输入整数")
            }else {
                if (y%1!==0){
                    alert("叫你输入整数！")

                }else {
                    if (y%4!==0){
                        alert(y+"年是平年")
                    }else {
                        if (y%400===0){
                            alert(y+"年是世纪闰年")
                        }else {
                            alert(y+"年是普通闰年")
                        }
                    }
                }
            }
        }
    </script>
</head>
<body>
    <button onclick="year()">点击</button>
</body>
</html>